function Logger(value, context) {
    const { kind, name } = context;
    if (kind === 'accessor') {
        const { set, get } = value;
        return {
            get() {
                console.log('装饰了字段', name, 'getter');
                return get.call(this)
            },
            set(val) {
                console.log('装饰了字段', name, 'setter');
                return set.call(this,val)           
            },
            init(initValue) {
                console.log('装饰了字段', name, 'init');
                return initValue + 10;
            }
        }
    }
}
class myClass {
    @Logger public accessor x = 1;

    #y=2;
}

let cla = new myClass();
cla.x = 10;
cla.x;
console.log(cla.x);

